$OpenBSD: patch-base_posix_unix_domain_socket_linux_cc,v 1.6 2017/04/19 05:16:46 robert Exp $
--- base/posix/unix_domain_socket_linux.cc.orig.port	Sat Aug 22 21:01:50 2015
+++ base/posix/unix_domain_socket_linux.cc	Wed Sep  2 07:31:54 2015
@@ -5,7 +5,10 @@
 #include "base/posix/unix_domain_socket_linux.h"
 
 #include <errno.h>
+#include <sys/types.h>
+#include <sys/param.h>
 #include <sys/socket.h>
+#include <sys/ucred.h>
 #include <unistd.h>
 
 #include <vector>
@@ -25,6 +28,14 @@ namespace base {
 
 const size_t UnixDomainSocket::kMaxFileDescriptors = 16;
 
+#ifndef SCM_CREDENTIALS
+#  define SCM_CREDENTIALS      0x9001
+#endif
+
+#ifndef SO_PASSCRED
+#  define SO_PASSCRED  0x9002
+#endif
+
 #if !defined(OS_NACL_NONSFI)
 // Creates a connected pair of UNIX-domain SOCK_SEQPACKET sockets, and passes
 // ownership of the newly allocated file descriptors to |one| and |two|.
@@ -150,7 +161,7 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd,
           cmsg->cmsg_type == SCM_CREDENTIALS) {
         DCHECK_EQ(payload_len, sizeof(struct ucred));
         DCHECK_EQ(pid, -1);
-        pid = reinterpret_cast<struct ucred*>(CMSG_DATA(cmsg))->pid;
+        pid = getpid();
       }
 #endif
     }
